<template>
  <!--- 经办 -->
  <view>
    <view v-if="handleList && handleList.length > 0">
      <view class="grid-body mt-30" v-for="(item, index) in handleList" :key="index">
        <view class="check grid-common">
          <view class="title flex">
            <image class="icon-style" src="/static/images/icon-stay.png" mode="aspectFill"></image>
            {{ item.examineTypeLabel }}
          </view>
          <view class="flex text">
            编号：<text>{{ item.code }}</text>
          </view>
          <view class="flex text">
            检修级别：<text>{{ item.examineLevelLabel }}</text>
          </view>
          <view class="flex text">
            设备分组：<text>{{ item.deviceGroupLabel }}</text>
          </view>
          <view class="flex text">
            设备类型：<text>{{ item.deviceTypeLabel }}</text>
          </view>
          <view class="flex text">
            设备名称：<text>{{ item.deviceName }}</text>
          </view>
          <view class="flex text">
            检修内容：<text>{{ item.examineContent }}</text>
          </view>
          <view class="footer-wrap">
            <view class="content-wrap">
              当前节点： <text class="text-grey">{{ item.nodeName }}</text>
            </view>
            <view class="button-wrap">
              <button class="button" @click="goView(item)">查看</button>
            </view>
          </view>
        </view>
      </view>
    </view>

    <view v-else>
      <Empty></Empty>
    </view>
  </view>
</template>

<script>
import Empty from '@/components/cu-empty/index.vue'
import { getHandle } from '@/api/repair/repair.js'
export default {
  name: 'pointCheck',
  components: {
    Empty
  },
  data() {
    return {
      handleList: []
    }
  },
  mounted() {
    this.getHandleList()
  },
  methods: {
    getHandleList() {
      getHandle().then((res) => {
        this.handleList = res.rows
      })
    },
    goView(item) {
      uni.navigateTo({
        url: '/pages/work/intelligentPatrolInspection/overhaulItem/components/view/index?id=' + item.id
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.check {
  position: relative;

  .title {
    font-size: 34rpx;
    font-weight: 700;
  }

  .icon-style {
    width: 52rpx;
    height: 52rpx;
    margin-right: 20rpx;
  }

  .text {
    display: flex;
    color: #999;

    text {
      color: #333;
      display: inline-block;
    }
  }

  .bor-top {
    padding-top: 20rpx;
    border-top: 1px solid #d5d7e3;
  }
}
</style>
